1. Field of the Invention
The present invention generally relates to method for writing and reading in flash memory, and more particularly to method for page random write and read in blocks of flash memory.
2. Description of the Prior Art
In general, NAND-type flash memory are popularly adopted in small memory card such as, compact flash (CF), secure digital (SD), multimedia card (MMC), etc. Conventional method for data accessing in flash memory, is in the unit of page to write/read data, and in the unit of block to erase data.
The common storing unit of page in flash memory is 512 bytes, 2K bytes or 4K bytes. Usually, each block in flash memory comprises 16 pages, 32 pages, or more pages. A flash memory, which storing unit of page is 2K bytes, is generally allowed to accessing parts of pages for 2 to 4 times, but repeatedly writing page would lead to damage of the flash memory or data losing. Besides, some NAND-type flash memory, must orderly write data from low page number to high page number, and the same page is only allowed to write data one more time.
However, if some pages in a block have to update data repeatedly, or some card reader don't write data from low page number to high page number orderly, would lead to copy all data from current block to a new block and then erase all data in current block just for updating the data of a page. Therefore, the data accessing time is raised and the life-span of flash memory is reduced.
As the foregoing discussion, conventional method for data accessing in flash memory, usually causes that data accessing time is raised and life-span of flash memory is reduced. Hence, a method could temporarily update the data in specific pages, then arrange all data later, is required, so that the method would avoid repeatedly copying data of whole block.